/*
 *  ICE_global_var.h
 *  ICE_Player
 *
 *  Created by xl on 11-7-3.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef ICE_BASE_VAR_H_
#define ICE_BASE_VAR_H_

#include "player_configure.h"
#include "Functions/file_list.h"
#include "web_server/web_server_proxy.h"

#ifdef __cplusplus
extern "C"{
#endif
	
#ifndef bool
#define bool char
#endif
	
#ifndef true
#define true 1
#endif
	
#ifndef false
#define false 0
#endif
    
#define IS_LITE_VERSION 1
    
#define WEB_FOLDER "/tmp/wifi_web/"
#define FILE_FOLDER "/Documents/"
#define WEB_PAGE_PATH "/tmp/wifi_web/index.html"
#define WIFI_TEMP_PATH "/tmp/wifi_tmp"
#define CONFIG_FILE_PATH "/Library/Caches/ice_config.xml"
#define THUMBNAIL_FOLDER "/tmp/thumb_nail/"
#define MOVIE_INFO_FOLDER "/tmp/movie_info/"
#define LOCKED_FOLDER_NAME ".locked/"
    
#define WEB_REDIR_SYMBOL "!!!Doc!!!"

#define MAX_ICE_URL_LEN (1024)
    
#define FILE_IO_BUFFER_LEN (16 * 1024)
    
#define MAX_IP_LEN (64)
#define LOCAL_WEB_SERVER_LEN (256)
	
#define DEFAULT_WEB_SERVER_PORT "10080"
    
#define STR_ICE_IMG "ice_img/"
    
#define STR_FILE_DIR_XML "file_dir.xml"
#define STR_INDEX_HTML "index.html"
 
#define STR_OLD_CONTANT_BG_PNG "contant_bg.p"
#define STR_OLD_HTML_BG_JPG "html_bg.j"
#define STR_OLD_LIST_BG_PNG "list_bg.p"
#define STR_OLD_LIST_FOCUS_PNG "list_focus.p"
#define STR_OLD_LOGO_PNG "logo.p"
#define STR_OLD_SIDEBAR1_BG_PNG "sidebar1_bg.p"
#define STR_OLD_W_AUDIO_PNG "w_audio.p"
#define STR_OLD_W_MOVIE_PNG "w_movie.p"
#define STR_OLD_W_OTHER_PNG "w_other.p"
#define STR_OLD_W_PICTURE_PNG "w_picture.p"
    
#define STR_CONTANT_BG_PNG "contant_bg.png"
#define STR_HTML_BG_JPG "html_bg.jpg"
#define STR_LIST_BG_PNG "list_bg.png"
#define STR_LIST_FOCUS_PNG "list_focus.png"
#define STR_LOGO_PNG "logo.png"
#define STR_SIDEBAR1_BG_PNG "sidebar1_bg.png"
#define STR_W_AUDIO_PNG "w_audio.png"
#define STR_W_MOVIE_PNG "w_movie.png"
#define STR_W_OTHER_PNG "w_other.png"
#define STR_W_PICTURE_PNG "w_picture.png"
    
//Resourse Path In Bundle
#define RESOURCE_PATH_LOCK "lock.png"
#define RESOURCE_PATH_UNLOCK "unlock.png"
#define RESOURCE_PATH_NO_LOOP "no_loop.png"
#define RESOURCE_PATH_LIST_LOOP "list_loop.png"
#define RESOURCE_PATH_SINGLE_LOOP "single_loop.png"
#define RESOURCE_PATH_RANDOM "random.png"
#define RESOURCE_PATH_PLAY "play.png"
#define RESOURCE_PATH_PAUSE "pause.png"
    //for iphone and ipad
#define RESOURCE_PATH_BG "bg.png"
#define RESOURCE_PATH_HD_BG "bg_hd.png"
#define RESOURCE_PATH_LOW_WND "low_wnd.png"
#define RESOURCE_PATH_HD_LOW_WND "low_wnd_hd.png"
#define RESOURCE_PATH_PANEL_BG "panel_bg.png"
#define RESOURCE_PATH_HD_PANEL_BG "panel_bg_hd.png"
#define RESOURCE_PATH_TIME_LINE "time_line.png"
#define RESOURCE_PATH_HD_TIME_LINE_BG "time_line_hd.png"
#define RESOURCE_PATH_VOLLINE "volline.png"
#define RESOURCE_PATH_HD_VOLLINE "volline_hd.png"
    
    
//Default Settings    
#define DEFAULT_CFG_ROTATION false
#define DEFAULT_CFG_FILE_LOCK false
#define DEFAULT_CFG_SUBTITLE true
#define DEFAULT_CFG_TEXT_INFO true
#define DEFAULT_CFG_LOOP_MODE E_LM_NO_LOOP
    
//Default Strings
#define UNKNOWN_FRAME_SIZE ""
#define UNKNOWN_DURATION ""
#define THUMBNAIL_FILE_AFFIX ".bmp"
#define MOVIE_INFO_FILE_AFFIX ".info"
#define MOVIE_INFO_FORMAT "%d %d %d"
    
extern ICE_CONFIG* g_ice_cfg;
extern WEB_SERVER_HANDLE g_web_server_handle;
extern char* g_web_server_html_path;
extern char g_cur_ip[MAX_IP_LEN];
extern char g_web_server_url[LOCAL_WEB_SERVER_LEN];
extern bool g_lock_screen_now;
extern bool g_is_in_player_now;
extern bool g_has_export_new_file;
extern char g_exported_new_file[MAX_ICE_URL_LEN];
extern FILE_INFO_LIST* g_current_file_list;
extern long g_cur_file_idx;
    
    
//utility functions
ICE_CONFIG* gf_get_ice_cfg();
bool gf_set_ice_cfg(ICE_CONFIG* cfg);
		
#ifdef __cplusplus
};
#endif

#endif /* end of #ifndef ICE_BASE_VAR_H_ */